import "./studentlook.scss";
import { store } from '../../../store/index'
import { Input, Form, DatePicker, Select, Button, Upload } from 'antd';
import { PlusOutlined } from '@ant-design/icons';
import { useEffect } from "react";



const Studentlook = () => {
    const [form] = Form.useForm();
  //查看数据 
  var dat= store.getState().student
  console.log(dat)
  useEffect(() => {
    form.setFieldsValue(dat)
}, [])
    return (
        <div className='studentlook'>
            <div className='top'>
                <div className="left">新增学生信息</div>
                <div className="right">&lt;返回</div>
            </div>
            <div className='form'>
                <div><h3>基本信息</h3></div>
                <div className='from1'>
                    <Form className="form_box" form={form}>
                    <div className="formlist">
                        <div className='title'>名字</div>
                        <Form.Item className='form_item' name="name">
                            <Input placeholder='用户名' />
                        </Form.Item>
                    </div>
                    <div className="formlist">
                        <div className='title'>电子邮件</div>
                        <Form.Item className='form_item' name="email">
                            <Input placeholder='电子邮件' />
                        </Form.Item>
                    </div>
                    <div className="formlist">
                        <div className='title'>班级</div>
                        <Form.Item className='form_item' name="class">
                            <Select placeholder="请选择所属班级">
                                <Select.Option value="demo">高二（1）班</Select.Option>
                                <Select.Option value="demo">高二（2）班</Select.Option>
                                <Select.Option value="demo">高二（3）班</Select.Option>
                            </Select>
                        </Form.Item>
                    </div>
                    <div className="formlist">
                        <div className='title'>性别</div>
                        <Form.Item className='form_item' name="sex">
                            <Select placeholder="性别">
                                <Select.Option value="demo">男</Select.Option>
                                <Select.Option value="demo">女</Select.Option>
                                <Select.Option value="demo">中性</Select.Option>
                            </Select>
                        </Form.Item>
                    </div>
                    <div className="formlist">
                        <div className='title'>出生日期</div>
                        <Form.Item className='form_item' >
                            <DatePicker placeholder='年/月/日' className='DatePicker' />
                        </Form.Item>
                    </div>
                    <div className="formlist">
                        <div className='title'>家庭住址</div>
                        <Form.Item className='form_item'>
                            <Input placeholder='请输入家庭住址' />
                        </Form.Item>
                    </div>

                    <div className="formlist">
                        <div className='title'>父母姓名</div>
                        <Form.Item className='form_item'>
                            <Input placeholder='请输入父母姓名' />
                        </Form.Item>
                    </div>
                    <div className="formlist">
                        <div className='title'>入学日期</div>
                        <Form.Item className='form_item' >
                            <DatePicker placeholder='年/月/日' className='DatePicker' />
                        </Form.Item>
                    </div>

                    <div className="formlist">
                        <div className='title'>父母联系电话</div>
                        <Form.Item className='form_item'>
                            <Input placeholder='请输入父母联系电话' />
                        </Form.Item>
                    </div>
                    </Form>
                </div>

                <div className='img'>
                    <div className='title'>头像照片</div>
                    <div>

                    </div>
                    <div className='title'>
                        <Upload action="/upload.do" listType="picture-card">
                            <div>
                                <PlusOutlined />
                                <div style={{ marginTop: 8 }}>Upload</div>
                            </div>
                        </Upload>
                    </div>
                    <div className='title'>单文件大小请在1M以内,仅支持JPG、JPEG、PNG格式</div>
                </div>
                <div className='bottombtn'>
                    <Button type="primary" className='Primary2'>取消</Button>&nbsp;&nbsp;&nbsp;&nbsp;<Button type="primary" className='Primary3' >保存</Button>
                </div>
            </div>
        </div>
    );
};

export default Studentlook;